package 第12届;

import java.math.BigInteger;
import java.util.Scanner;

public class F_时间显示 {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();

		if(s.length() < 4) {
			System.out.println("00:00:00");
		} else {
			// 去掉毫秒的三个0，转换成秒
			s = s.substring(0,s.length() - 3);
		}
		
		BigInteger six = BigInteger.valueOf(60);
		BigInteger bi = new BigInteger(s);
		// 一天的秒数
		BigInteger day = BigInteger.valueOf(86400);
		// 去掉超过一天的秒数
		bi = bi.mod(day);
		if(bi.toString().length() < 1) {
			System.out.println("00:00:00");
		} else {
			int hour = bi.divide(six).divide(six).intValue();
			// 剩余秒数 = 总秒数-小时秒数
			bi = bi.subtract(BigInteger.valueOf(hour * 60 * 60));
			int minute = bi.divide(six).intValue();
			bi = bi.subtract(BigInteger.valueOf(minute * 60));
			int second = bi.intValue();
			
			String sHour = String.valueOf(hour);
			String sMinute = String.valueOf(minute);
			String sSecond = String.valueOf(second);
			
			if(sHour.length() == 1) {
				sHour = "0" + sHour;
			}
			if(sMinute.length() == 1) {
				sMinute = "0" + sMinute;
			}
			if(sSecond.length() == 1) {
				sSecond = "0" + sSecond;
			}
			
			System.out.println(sHour + ":" + sMinute + ":" + sSecond);
		}
		
		
		scan.close();
		
	}
}
